package sk.marek.barak.server;

import java.util.List;

import sk.marek.barak.client.Coment;
import sk.marek.barak.client.LoginInfo;
import sk.marek.barak.client.UserInformation;
import sk.marek.barak.client.UserThought;

public class Facade {
	private static CommentDAO commentDAO;
	private static LoggedInDAO loggedInDAO;
	private static LoginInfoDAO logginInfoDAO;
	private static MessageDAO messageDAO;
	private static ThoughtDAO thoughtDAO;
	private static TokenDAO tokenDAO;
	private static UserInformationDAO userInformationDAO;
	static{
		commentDAO = new CommentGAEDAO();
		loggedInDAO = new LoggedInGAEDAO();
		logginInfoDAO = new LoginInfoGAEDAO();
		messageDAO = new MessageGAEDAO();
		thoughtDAO = new ThoughtGAEDAO();
		tokenDAO = new TokenGAEDAO();
		userInformationDAO = new UserInformationGAEDAO();
	}
	
	
	public static  Coment addComent(String text, String thoughtId){
		return commentDAO.addComent(text, thoughtId);
	};
	public static void removeComent(String key){
		commentDAO.removeComent(key);
	};
	public static  List<Coment> getThoughtComents(String thoughtId){
		return commentDAO.getThoughtComents(thoughtId);
	};
	public static void removeThoughtComents(String thoughtId){
		commentDAO.removeThoughtComents(thoughtId);
	};
	public static void loggedIn(){
		loggedInDAO.loggedIn();
	};
	public static void loggedOut(){
		loggedInDAO.loggedOut();
	};
	public static List<UserInformation> getLoogedInUsers(){
		return loggedInDAO.getLoogedInUsers();
	};
	
	public static LoginInfo login(String requestUrl) {
		return logginInfoDAO.login(requestUrl);
	}
	public static void sendMessage(String userId,String message){
		messageDAO.sendMessage(userId, message);
	};
	public static String getMessage(String userId){
		return messageDAO.getMessage(userId);
	};
	public static List<UserThought> getUserThoughts(String userID){
		return thoughtDAO.getUserThoughts(userID);
	};
	public static UserThought saveThought(String text){
		return thoughtDAO.saveThought(text);
	};
	public static void deleteThought(String key){
		thoughtDAO.deleteThought(key);
	};
	public static List<UserThought> getUsersThought(List<String> usersID){
		return thoughtDAO.getUsersThought(usersID);
	};
	public static List<String> getTokens(){
		return tokenDAO.getTokens();
	};
	public static void sendToken(String user){
		tokenDAO.sendToken(user);
	};
	public static UserInformation getUser(String userId){
		return userInformationDAO.getUser(userId);
	};
	public static void saveUser(UserInformation user){
		userInformationDAO.saveUser(user);
	};
	public static UserInformation getCurentUserInformation(){
		return userInformationDAO.getCurentUserInformation();
	};

	
};
	
